package com.gkoudai.open.platform.listener;

import com.gkoudai.open.platform.handler.DataHandler;
import io.socket.emitter.Emitter;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.util.Arrays;

/**
 * @author : Amater
 * @date : 2025/4/15 16:04
 */
@Slf4j
@AllArgsConstructor
public class SubscribeNewFuturesQuoteListener implements Emitter.Listener{
    private DataHandler dataHandler;
    @Override
    public void call(Object... objects) {
        String s = Arrays.toString(objects);
        String res = s.substring(1, s.length() - 1);
        if (dataHandler != null) {
            dataHandler.subscribeNewFuturesQuoteListener(res);
        }else{
            log.info("subscribeQuoteResponse:{}",res);
        }
    }
}
